interface ItemType{
    // map(arg0: (item: any) => void): string;
    img:string,
    title:string,
    desc:string,
    id:string
}

interface dataType{
    code:number,
    data:ItemType[]
}
Ajax('/api/list',(data:dataType)=>{
    return renderList(data.data);
})
function renderList(data:ItemType[]){
    const box=document.querySelector('.box');
    (box as Element).innerHTML=data.map(item=>{
        return`
        <div>
            <h3>${item.title}</h3>
            <img src='${item.img}' alt />
            <p>${item.desc}</p>
        </div>
        `
    }).join('')
}

